//
//  GQLoginTool.m
//  GuQu
//
//  Created by HELIUM STAR on 15/6/16.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "GQLoginTool.h"
#import "GQHttpTool.h"
#import "GQLoginParam.h"
#import "GQLoginResult.h"

@implementation GQLoginTool

+ (void)loginWithParam:(GQLoginParam *)parameters success:(void (^)(GQLoginResult *))success failure:(void (^)(NSError *))failure
{
    

     NSString *url = [NSString stringWithFormat:@"%@/login", kServerDomain];
    
    [GQHttpTool POST:url parameters:parameters.keyValues success:^(id responseObject) {
        GQLoginResult *result = [GQLoginResult objectWithKeyValues:responseObject];
        if (success) {
            success(result);
        }
    } failure:^(NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

@end
